package com.example.myapplication001.slice.home_page;

import com.example.myapplication001.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Button;
import ohos.agp.components.Component;
import ohos.agp.components.Image;

//我的
public class MyAbilitySlice extends AbilitySlice {
    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_my);

        Button button_jk =(Button) findComponentById(ResourceTable.Id_button_jk);
        button_jk.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入MainAbilitySlice
                present(new com.example.myapplication001.slice.home_page.MainAbilitySlice(),new Intent());
            }
        });

        Image image_jk =(Image) findComponentById(ResourceTable.Id_image_jk);
        image_jk.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入MainAbilitySlice
                present(new MainAbilitySlice(),new Intent());
            }
        });

        Button button_yq =(Button) findComponentById(ResourceTable.Id_button_qy);
        button_yq.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入FriendsAbilitySlice
                present(new com.example.myapplication001.slice.home_page.FriendsAbilitySlice(),new Intent());
            }
        });

        Image image_qy =(Image) findComponentById(ResourceTable.Id_image_qy);
        image_qy.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入FriendsAbilitySlice
                present(new FriendsAbilitySlice(),new Intent());
            }
        });


    }
    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}



